﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:s="http://schemas.microsoft.com/surface/2008"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/CircularSurfaceListBoxControlLibrary;component/CircularSurfaceListBoxControlLibrary.xaml" />
        <ResourceDictionary Source="BlueButton.xaml"/>
        <ResourceDictionary Source="CircularMenu.xaml" /><!--<ResourceDictionary Source="ButtonProperties.xaml" />-->
        <ResourceDictionary Source="ButtonPropertiesGeneral.xaml"/>
        <!--<ResourceDictionary Source="CarousselListBoxIcons.xaml"/>-->
    </ResourceDictionary.MergedDictionaries>
    <Style x:Key="GameCircularSurfaceToggleButtonStyle" TargetType="{x:Type s:SurfaceToggleButton}">
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="Background" Value="#FF218BC7" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type s:SurfaceToggleButton}">
                    <Grid>
                        <Ellipse Margin="0.166,0,0.912,0.334" StrokeThickness="0.1" Opacity="0.445">
                            <Ellipse.Stroke>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF454545" Offset="1"/>
                                    <GradientStop Color="#FF6A6A6A"/>
                                </LinearGradientBrush>
                            </Ellipse.Stroke>
                        </Ellipse>
                        <Ellipse Margin="0.282,0.119,1.042,0.462" StrokeThickness="0.1" Opacity="0.29">
                            <Ellipse.Stroke>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFA3A3A3" Offset="1"/>
                                    <GradientStop Color="#FF0017FF"/>
                                </LinearGradientBrush>
                            </Ellipse.Stroke>
                        </Ellipse>
                        <ContentPresenter x:Name="Content" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                        <Rectangle Fill="{StaticResource Properties}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="GameCircularSurfaceListBoxStyle" TargetType="{x:Type s:SurfaceListBox}" BasedOn="{StaticResource CircularSurfaceListBoxStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type s:SurfaceListBox}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="ItemPresenterOpenStoryboard" FillBehavior="Stop">
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                <SplineDoubleKeyFrame KeySpline="0,0,0,1" KeyTime="00:00:03" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                <SplineDoubleKeyFrame KeySpline="0,0,0,1" KeyTime="00:00:03" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="180"/>
                                <SplineDoubleKeyFrame KeySpline="0,0,0,1" KeyTime="00:00:03" Value="360"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Center" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                <SplineDoubleKeyFrame KeySpline="0,0.33,0,1" KeyTime="00:00:00.5000000" Value="0.7"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:02.4000000" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Center" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                <SplineDoubleKeyFrame KeySpline="0,0.33,0,1" KeyTime="00:00:00.5000000" Value="0.7"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:02.4000000" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemPresenter" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                                <DiscreteObjectKeyFrame KeyTime="00:00:03" Value="{x:Static Visibility.Collapsed}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:00.7000000" Value="0.716"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:03" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                        <Storyboard x:Key="ItemPresenterCloseStoryboard" FillBehavior="Stop">
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                <SplineDoubleKeyFrame KeyTime="00:00:03" Value="0"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                <SplineDoubleKeyFrame KeyTime="00:00:03" Value="0"/>
                            </DoubleAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemPresenter" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.6000000" Value="{x:Static Visibility.Collapsed}"/>
                                <DiscreteObjectKeyFrame KeyTime="00:00:03" Value="{x:Static Visibility.Visible}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:03" Value="180"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0.654"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="0"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:03" Value="0"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Border x:Name="Border" Margin="{TemplateBinding Padding}" ClipToBounds="False" OpacityMask="{x:Null}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="360" Padding="0" Background="Transparent">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="0.3*"/>
                                <ColumnDefinition Width="0.5*"/>
                                <ColumnDefinition Width="0.3*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="0.3*"/>
                                <RowDefinition Height="0.5*"/>
                                <RowDefinition Height="0.3*"/>
                            </Grid.RowDefinitions>
                            <ItemsPresenter x:Name="ItemPresenter" Margin="0" ClipToBounds="False" OpacityMask="{x:Null}" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Visibility="Visible" Grid.RowSpan="3" Grid.ColumnSpan="3">
                                <ItemsPresenter.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </ItemsPresenter.RenderTransform>
                            </ItemsPresenter>
                            <s:SurfaceToggleButton x:Name="Center"
                                                       Style="{StaticResource GameCircularSurfaceToggleButtonStyle}"
                                                       Grid.Row="1"
                                                       Grid.Column="1">
                                <s:SurfaceToggleButton.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </s:SurfaceToggleButton.RenderTransform>
                                <s:SurfaceToggleButton.BorderBrush>
                                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                        <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                        <GradientStop Color="White" Offset="1"/>
                                    </LinearGradientBrush>
                                </s:SurfaceToggleButton.BorderBrush>
                            </s:SurfaceToggleButton>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <EventTrigger RoutedEvent="FrameworkElement.Unloaded">
                            <BeginStoryboard x:Name="ItemPresenterCloseStoryboard_BeginStoryboard1" Storyboard="{StaticResource ItemPresenterCloseStoryboard}"/>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                            <BeginStoryboard Storyboard="{StaticResource ItemPresenterOpenStoryboard}"/>
                        </EventTrigger>
                        <Trigger Property="IsChecked" Value="False" SourceName="Center">
                            <Trigger.EnterActions>
                                <BeginStoryboard x:Name="ItemPresenterCloseStoryboard_BeginStoryboard" Storyboard="{StaticResource ItemPresenterCloseStoryboard}"/>
                            </Trigger.EnterActions>
                        </Trigger>
                        <Trigger Property="s:Contacts.IsAnyContactCaptured" Value="False"/>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="BorderBrush" TargetName="Border" Value="#33000000"/>
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="True">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
                        </Trigger>
                        <Trigger Property="IsChecked" SourceName="Center" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource ItemPresenterOpenStoryboard}"/>
                            </Trigger.EnterActions>
                            <Setter Property="Visibility" TargetName="ItemPresenter" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>